package com.itheima.mapper;

import com.itheima.pojo.OperateLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 16778
 * @version 1.0
 * @date 2025/9/23 21:16
 */
@Mapper
public interface OperateLogMapper {
    @Insert("insert into operate_log(operate_emp_id, operate_time, class_name, method_name, method_params, return_value, cost_time) " +
            "VALUES (#{operateEmpId},#{operateTime},#{className},#{methodName},#{methodParams},#{returnValue},#{costTime})")
    public void insert(OperateLog log);

    @Select("select o.*,emp.name operateEmpName from operate_log o left join emp on o.operate_emp_id = emp.id")
    List<OperateLog> page();
}
